#if defined(_MSC_VER)
#pragma once
#endif

#ifndef LM_VOLUME_HOMOGENEOUS_H
#define LM_VOLUME_HOMOGENEOUS_H

#include "../core/volume.h"
#include "../core/transform.h"

class HomogeneousVolume : public VolumeRegion {
public:
	HomogeneousVolume(const Transform *w2v, const Transform *v2w, Spectrum sa, Spectrum ss, Spectrum l, float g, BBox e);
	BBox WorldBound() const;
	bool IntersectP(const Ray &ray, float *t0, float *t1) const;
	Spectrum sigma_a(const Point3 &, const Vector3 &) const;
	Spectrum sigma_s(const Point3 &p, const Vector3 &w) const;
	Spectrum sigma_t(const Point3 &p, const Vector3 &w) const;
	Spectrum Lve(const Point3 &, const Vector3 &) const ;
	float p(const Point3 &, const Vector3 &, const Vector3 &) const ;
	Spectrum tau(const Ray &ray, float step  = 1.f, float offset = 0.5) const;
private:
	Spectrum sig_a, sig_s, le;
	float g;
	BBox extent;
	const Transform *worldToVolume;
	const Transform *volumeToWorld;
};

#endif	// LM_VOLUME_HOMOGENEOUS_H